package org.javaapps.demo.common;

import java.util.List;

public class QueryCondition {
	public static String getAndEqual(boolean first, String name){
		if(first){
			return " where " + name + " = ?";
		}
		return " and " + name + " = ?";
	}

	public static String getAndEqual(List<String> list, boolean first, String name, String value){
		list.add(value);
		if(first){
			return " where " + name + " = ?";
		}
		return " and " + name + " = ?";
	}
}
